#include "loginform.h"
#include "ui_loginform.h"
#include <QApplication>
#include <QKeyEvent>
#include <QDebug>
#include "netset.h"

class CustomApplication : public QApplication
{
public:
    LoginForm w;

    CustomApplication(int argc, char* argv[]) : QApplication(argc, argv) {
        w.show();

        // 安装事件过滤器
        if (w.ui->signinpushButton) {
            w.ui->signinpushButton->installEventFilter(&w);
        } else {
            qDebug() << "signinpushButton 事件未初始化。";
        }
    }

    bool notify(QObject *receiver, QEvent *event) override {
        return QApplication::notify(receiver, event);
    }
};


// 主函数，程序入口
int main(int argc, char *argv[])
{
    CustomApplication app(argc, argv); // 使用自定义的 CustomApplication
//    QApplication app(argc, argv);
//    Netset w;
//    w.show();

    return app.exec();                 // 开启事件循环
}
